package org.dromara.germbank.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.profiles.api.dto.DonorListDTO;
import org.dromara.profiles.api.dto.DonorQueryDTO;
import org.dromara.profiles.api.service.RemoteDonorService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 捐赠者controller
 *
 * @author congxing
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/donor")
public class BusCustomerDonorController extends BaseController  {


    @DubboReference(check = false)
    private RemoteDonorService remoteDonorService;

    /**
     * 查询捐赠者管理列表
     */
    @SaCheckPermission("partners:clinics:list")
    @GetMapping("/list")
    public TableDataInfo<DonorListDTO> list(DonorQueryDTO query, PageQuery pageQuery) {
        return remoteDonorService.listDonor(query, pageQuery);
    }
}
